java.lang.ObjectCard
public class Card
A Card is a playing card from an Anglo-American deck of cards.
| Constructor Summary | |
|---|---|
Card(java.lang.String suit,
int rank)
Constructs a new card with the specified suit and rank. |
|
| Method Summary | |
|---|---|
boolean |
hasSameRank(Card aCard)
Determines if this card has the same rank as the specified card. |
boolean |
isEqualTo(Card aCard)
Determines if this card is equal to the specified card. |
int |
rank()
Returns this card's rank. |
java.lang.String |
suit()
Returns this card's suit. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Card(java.lang.String suit,
int rank)
| Method Detail |
|---|
public boolean hasSameRank(Card aCard)
a - card
public boolean isEqualTo(Card aCard)
the - specified card.
public int rank()
public java.lang.String suit()